package anna.lopez.mora;


import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.DisplayMetrics;
import android.view.animation.AnimationUtils;
import android.widget.ImageView;

public class JocActivity extends Activity {
    /** Called when the activity is first created. */
	Thread canvipantalla;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        //Variables globals
        GV.Screen.metrics = new DisplayMetrics();
		getWindowManager().getDefaultDisplay().getMetrics(GV.Screen.metrics);
        
        ImageView rodagran = (ImageView)findViewById(R.id.carga);
		rodagran.startAnimation(AnimationUtils.loadAnimation(this, R.anim.rotacarrega));
		ImageView mariosalta = (ImageView)findViewById(R.id.salto);
		mariosalta.startAnimation(AnimationUtils.loadAnimation(this, R.anim.salta_mario));
		canvipantalla = new Thread() {
			public void run() {
				try {
					sleep(3000);
					Intent i = new Intent("anna.lopez.mora.PRINCIPAL");
					startActivity(i);
				}
				catch (InterruptedException e) {
		            e.printStackTrace();
				}
				finally {
					finish();
				}
			}
		};
		canvipantalla.start();
    }
}